package com.example.httpdemo.demos.controller;

import com.example.httpdemo.demos.service.IOkHttpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 〈〉
 *
 * @author hero
 * @create 2024/5/17
 * @since 1.0.0
 */
@RestController
@RequestMapping("/demo")
public class MyHttpController {

    @Autowired
    IOkHttpService okHttpService;

    @GetMapping("/get")
    public String testGet() throws Exception{
        System.out.println(okHttpService.testGet());
        return okHttpService.testGet();
    }

    @PostMapping("/post")
    public String testPost() throws Exception{
        System.out.println(okHttpService.testPost());
        return okHttpService.testPost();
    }



}